package com.coocaa.typhoon.api.v1.userfile;

import com.coocaa.cirrus.common.base.model.RespBase;
import com.coocaa.cirrus.common.base.util.JsonUtil;
import com.coocaa.typhoon.api.third.volcengine.service.VikingDbUserFileService;
import com.coocaa.typhoon.api.v1.init.VikingInitService;
import com.coocaa.typhoon.api.v1.userfile.model.input.GetSearchDataModel;
import com.coocaa.typhoon.api.v1.userfile.util.UserFileParamCheckUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author bijiahao
 * @date : 2025/10/21 16:53
 * @description
 */
@Slf4j
@RestController
@RequestMapping("/v1/vikingDb")
@Tag(name = "VikingDb测试")
public class TestVikingDbController {
    @Autowired
    private VikingDbUserFileService vikingDbUserFileService;
    @Autowired
    private VikingInitService vikingInitService;

    @Operation(summary = "初始数据")
    @PostMapping(value = "/initData")
    public RespBase<Object> initData(@RequestBody GetSearchDataModel dataModel) throws Exception {
        vikingInitService.init(dataModel);
        return new RespBase().setSuccessResult();
    }

    @Operation(summary = "测试删除")
    @GetMapping(value = "/testDel")
    @Parameters({
            @Parameter(name = "userId", example = "xxxx", description = "用户ID")
    })
    public RespBase testDel(@RequestParam String userId) throws Exception {
        vikingDbUserFileService.delete(userId);
        return new RespBase().setSuccessResult();
    }

}
